package com.adv.ems.model.vo;

import com.adv.ems.db.entity.ItemInfoDO;
import com.adv.ems.utils.EmsUtil;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class EnergyBaseItemListVO {
    private List<Info> list;

    public EnergyBaseItemListVO() {
        this.list = new ArrayList<Info>();
    }

    @Data
    public static class Info {
        private Long itemId;
        private String itemName;
        private String itemCode;

        public Info(ItemInfoDO item, String acceptLanguage) {
            this.itemId = item.getId();
            this.itemName = EmsUtil.multilingual(item.getNameInfo(), acceptLanguage);
        }
    }
}
